home *** CD-ROM | disk | FTP | other *** search
/ Champak 114 / Vol 114.iso / games / y2k_tetr.swf / scripts / DefineSprite_42 / frame_3 / DoAction.as
Encoding:
Text File  |  2010-08-12  |  1.6 KB  |  61 lines

  1. result = "nook";
  2. tek_x = getProperty("../figure", _X);
  3. tek_y = getProperty("../figure", _Y);
  4. tek_xm = eval("..:max_x") * "10";
  5. tek_ym = eval("..:max_y") * "10";
  6. fl1 = "0";
  7. n = "1";
  8. while("4" >= n)
  9. {
  10.    if(n == "1")
  11.    {
  12.       tposx = (getProperty("../figure", _X) + getProperty("../figure/k1", _X) - "5") / "10" + "1";
  13.       tposy = (getProperty("../figure", _Y) + getProperty("../figure/k1", _Y) - "5") / "10" + "1";
  14.    }
  15.    if(n == "2")
  16.    {
  17.       tposx = (getProperty("../figure", _X) + getProperty("../figure/k2", _X) - "5") / "10" + "1";
  18.       tposy = (getProperty("../figure", _Y) + getProperty("../figure/k2", _Y) - "5") / "10" + "1";
  19.    }
  20.    if(n == "3")
  21.    {
  22.       tposx = (getProperty("../figure", _X) + getProperty("../figure/k3", _X) - "5") / "10" + "1";
  23.       tposy = (getProperty("../figure", _Y) + getProperty("../figure/k3", _Y) - "5") / "10" + "1";
  24.    }
  25.    if(n == "4")
  26.    {
  27.       tposx = (getProperty("../figure", _X) + getProperty("../figure/k4", _X) - "5") / "10" + "1";
  28.       tposy = (getProperty("../figure", _Y) + getProperty("../figure/k4", _Y) - "5") / "10" + "1";
  29.    }
  30.    if(int(tposy) - tposy == "0")
  31.    {
  32.       if(eval("..:dim" add tposx add "_" add tposy) eq "")
  33.       {
  34.          fl1 += "1";
  35.       }
  36.    }
  37.    else
  38.    {
  39.       m = int(tposy) - tposy;
  40.       if("0" < m)
  41.       {
  42.          ty = tposy - m;
  43.       }
  44.       else
  45.       {
  46.          ty = tposy + m;
  47.       }
  48.       ty1 = ty + "1";
  49.       if(eval("..:dim" add tposx add "_" add ty) eq "" and eval("..:dim" add tposx add "_" add ty1) eq "")
  50.       {
  51.          fl1 += "1";
  52.       }
  53.    }
  54.    n += "1";
  55. }
  56. if(fl1 == "4")
  57. {
  58.    result = "ok";
  59. }
  60. stop();
  61.